package com.jdrx.sw.sewage.dao;

import com.jdrx.sw.sewage.beans.dto.StockDevDTO;
import com.jdrx.sw.sewage.beans.dto.UnLimitDevDTO;
import com.jdrx.sw.sewage.beans.entity.DevStoragePO;
import com.jdrx.sw.sewage.beans.vo.DevStorageInfoVO;
import com.jdrx.sw.sewage.beans.vo.DevStorageVO;
import com.jdrx.sw.sewage.beans.vo.StockDevVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * Created by generator on 2020-10-12.
 */
@Mapper
public interface DevStorageDAO {

    Integer countDevNum(@Param("devType") Integer devType,
                        @Param("storageTypeId") Long storageTypeId);

    List<DevStorageVO> selectDevStorageList(@Param("devType") Integer devType,
                                            @Param("storageTypeId") Long storageTypeId);

    List<Map<Integer, Integer>> selectDevNum(@Param("storageTypeId") Long storageTypeId);

    DevStorageInfoVO selectDevInfo(@Param("devId") Long devId);

    DevStorageInfoVO selectDevInfo2(@Param("devId") Long devId);

    int countById(@Param("devId") Long devId,
                  @Param("storageTypeId") Long storageTypeId);

    void deleteById(@Param("devId") Long devId);

    void updateDev(DevStoragePO devStoragePO);

    void add(DevStoragePO devStoragePO);

    List<StockDevVO> selectByMeIdAndCaIdAndDs(StockDevDTO stockDevDTO);

    Integer selectAttachmentNum(@Param("devType") Integer devType,
                                @Param("dossierSpec") String dossierSpec,
                                @Param("categoryId") Long categoryId,
                                @Param("materielId") Long materielId);

    List<String> selectDossierSpec(@Param("materielId") Long materielId,
                                   @Param("categoryId") Long categoryId);

    Long selectNextId();

    List<DevStoragePO> findAllList(@Param("dataNode") String dataNode);

    List<DevStoragePO> findCollectAllList(@Param("dataNode") String dataNode);

    void maintenanceCycleDay(@Param("dataNode") String dataNode,
                             @Param("id") Long id,
                             @Param("cycleTime") Integer cycleTime);

    void maintenanceCycleHour(@Param("dataNode") String dataNode,
                              @Param("id") Long id,
                              @Param("workTime") Integer workTime);

    DevStorageInfoVO selectUnlimitedDevInfo(UnLimitDevDTO dto);

    Integer countDevBYStorageNum(@Param("storageNum") String storageNum);

    void batchUpdateById(Map<String, Object> params);
}